package main

import (
	"fmt"
	"go-rpc/service"
	"log"
	"net/rpc"
)

func main() {

	client, err := rpc.Dial("tcp", "localhost:9091") // 进行拨号

	if err != nil {
		log.Fatal("dialing:", err) // 拨号失败

	}
	args := &service.Args{10, 20} // 制造请求参数

	var reply int

	divCall := client.Go("ServiceA.Add", args, &reply, nil)
	replyCall := <-divCall.Done
	fmt.Println(replyCall.Error)
	fmt.Println(reply)

}
